<template>
  <view class="inner">
    <view v-for="(item, index) in remarks" :key="index">
      <remark-card
        mode="widthFix"
        :item="item"
        @addLikes="addLikes(index)"
        @addComments="addComments(item)"
      ></remark-card>
    </view>
    <!-- <view v-if="remarks.length !== 0">
        <uni-pagination
                :total="total"
                :current="pageQuery.pageNum"
                :pageSize="pageQuery.pageSize"
                @change="handlePageChange"
        >
        </uni-pagination>
    </view> -->
	<view v-if="remarks.length === 0">
		<!-- 校内星球里还没有同学添加点评呢~<br>快快去首页点击加号创建吧~ -->
    <no-data></no-data>
	</view>
  </view>
</template>

<script>
import RemarkCard from '@/components/RemarkCard'
import {getInnerRemarkList, dianzan, notLike} from '@/api/remark'
import {mapState} from 'vuex'
import {uniPagination} from '@dcloudio/uni-ui'
import NoData from '../../../components/NoData.vue'
export default {
  name: 'share-inner',
  components: {
    RemarkCard, uniPagination, NoData
	},
	props: ['remarks'],
	computed: {
    ...mapState(['userInfo'])
  },
  data() {
    return {
      // 美食评价
			// remarks: [],
			schoolId: 0,
			dianZanItem: {}
    }
  },
  methods: {
    // 点赞
    addLikes(index) {
			this.$emit('addLikes', index)
		},
    // 评论
    addComments(item) {
      // todo:弹出评论表单+调用接口
      item.comments++
      this.gotoDetail(item.id)
    },
    gotoDetail(id) {
      uni.navigateTo({
        url: '/pages/detail/index?id=' + id
      })
		},
	}
}
</script>

<style lang='scss'>
  .inner {
    height: 100%;
	.no-data {
	  padding: 10px 15px;
	  font-size: 14px;
	  color: #666;
	  border-bottom: 1px #f5f5f5 solid;
	}
  }
</style>
